﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Rendering
{
    using Acoris.Rendering;

#if NETFX_CORE || WINDOWS_UWP
    using Microsoft.Graphics.Canvas;
    using Microsoft.Graphics.Canvas.Text;
#endif

    /// <summary>
    /// 表示一个呈现上下文
    /// </summary>
    public sealed class DrawingSession
    {

        //---------------------------------------------------------------------------------------------------
        //  该类的生命周期应该与控件生存周期一致
        //  该类的
        //---------------------------------------------------------------------------------------------------
#if NETFX_CORE || WINDOWS_UWP
        ICanvasResourceCreator _resource;

        public DrawingSession(ICanvasResourceCreator sender) {
            _resource = sender ?? throw new NullReferenceException();
        }


        public CanvasTextLayout CreateCanvasTextLayout(string text,CanvasTextFormat format)
        {
            // TODO:添加代理创建文本布局的方法
            return null;
        }

        public CanvasTextLayout CreateCanvasTextLayout(TextElement text)
        {
            return CreateCanvasTextLayout(text.Text, text.Format);
        }
#endif
    }
}
